rulesystem MoC {
    
  rule markRemoved(v: Infom)   { modify { eval { v.effect = "local"; v.ct = "removed";   } } }
  rule markReordered(v: Infom) { modify { eval { v.effect = "local"; v.ct = "reordered"; } } }    
  rule markRenamed(v: Infom)   { modify { eval { v.effect = "local"; v.ct = "renamed";   } } }
  rule markRephrased(v: Infom) { modify { eval { v.effect = "local"; v.ct = "rephrased"; } } }
        
  rule rippleRemoved {
    provider:Infom -:requiredBy-> dependent:Infom;
    if
    { 
         dependent.effect == "none"
      && provider.ct == "removed";
    }
    modify {
      eval {
        dependent.effect = "implicit";
        dependent.ct     = provider.ct;
        dependent.purl   = provider.url;
        dependent.pxp    = provider.xpath;
      }
    }
  }
    
  rule rippleRephrased {
    provider:Infom -d:requiredBy-> dependent:Infom;
    if
    {
          dependent.effect == "none"
       && provider.ct == "rephrased"
       && d.via == "literal";
    }
    modify {
      eval {
        dependent.effect = "implicit";
        dependent.ct     = provider.ct;
        dependent.purl   = provider.url;
        dependent.pxp    = provider.xpath;
      }
    }
  }
    
  rule slurp {
    x: Infom;
    negative { if { x.effect == "local" || x.effect == "implicit"; } }
    replace {}
  }
        
}
